cmake_minimum_required(VERSION 2.8)
#执行输出目录
MESSAGE(STATUS "path  is :" ${PROJECT_BINARY_DIR})
set(CXX_FLAGS
        -g
        -DCHECK_PTHREAD_RETURN_VALUE
        -D_FILE_OFFSET_BITS=64
        -Wall
        -Wextra
        # -Werror
        -Wconversion
        # -Wno-unused-parameter
        # -Wold-style-cast
        -Woverloaded-virtual
        -Wpointer-arith
        -Wshadow
        -Wwrite-strings
        -march=armv4
        -rdynamic
        -fpermissive
        )
if(CMAKE_BUILD_BITS EQUAL 32)
    list(APPEND CXX_FLAGS "-m32")
endif()

string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CXX_FLAGS}")

MESSAGE(STATUS ${CMAKE_CXX_FLAGS})

set(CMAKE_FIND_ROOT_PATH "/usr/local/arm/arm-2009q3")
set(CMAKE_CXX_COMPILER "/usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-g++")
set(CMAKE_CXX_FLAGS_DEBUG "-O0")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -finline-limit=1000 -DNDEBUG")
set(LIBRARY_OUTPUT_PATH ./)
set(BUILD_SHARED_LIBS "ON")



INCLUDE_DIRECTORIES(
        ${PROJECT_SOURCE_DIR}/mudo_net_test/db
)
set(src
        sqlite3.c
        )


add_library(sqlite3 SHARED ${src})
target_link_libraries(sqlite3 dl pthread rt )

